##########################################################################
# categorizing the party system based on the effective number of parties #
##########################################################################

library(openxlsx)
library(psych)

#load data
df_cpds<-read.csv("CPDS.csv")
attach(df_cpds)
summary(df_cpds)

#checking the quantile
df_eff<-data.frame(effpar_ele,effpar_leg)
summary(df_eff)
describe(df_eff)

#germany : checking the mean
germany<-subset(df_cpds,iso=="DEU")
df_eff_ger<-data.frame(germany$effpar_ele,germany$effpar_leg)
describe(df_eff_ger)

#japan : checking the mean
japan<-subset(df_cpds,iso=="JPN")
df_eff_jap<-data.frame(japan$effpar_ele,japan$effpar_leg)
describe(df_eff_jap)

#uk : checking the mean
uk<-subset(df_cpds,iso=="GBR")
df_eff_uk<-data.frame(uk$effpar_ele,uk$effpar_leg)
describe(df_eff_uk)

#usa : checking the mean
usa<-subset(df_cpds,iso=="USA")
df_eff_usa<-data.frame(usa$effpar_ele,usa$effpar_leg)
describe(df_eff_usa)

#denmark : checking the mean
dnk<-subset(df_cpds,iso=="DNK")
df_eff_dnk<-data.frame(dnk$effpar_ele,dnk$effpar_leg)
describe(df_eff_dnk)